home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc A) / Acorn User China CD-ROM (UK) (Disc A).bin / HENSA / COLOUR / RGB.TXT < prev    next >
Encoding:
Text File  |  1999-03-12  |  3.6 KB  |  106 lines

  1.                                    RGBDecode
  2.                                    =========
  3.  
  4. Version 1.02 (02 Dec 1997)
  5.      
  6. Introduction
  7. ------------
  8. If you've used the X window system then you'll no doubt have come across the
  9. concept of colour naming. Indeed, this seems to be an emerging trend on the
  10. web to use constructs such as <font color="<name>|#<number>"> to change the
  11. style of pages (well, maybe not so much a trend as a standard then... call it
  12. what you will, but until an RFC comes out I'll just call it a trend, ok ?)
  13.  
  14. However, we've no concept of this on the Arc. So, the RGBDecode module is
  15. intended to fill this gap by allowing you to specify colour names and to have
  16. these converted to numbers and back again.
  17.  
  18.  
  19. Usage
  20. -----
  21. The module works by pair of SWIs which look up the information requested in
  22. the file InetDBase:RGB - whilst this is not currently standard, I hope to
  23. convince enough people to make it so :-)
  24.  
  25. The calls are (SWI chunk un-registered, but will be soon, honest) :
  26.  
  27. RGB_DecodeName (&90680 for the time being)
  28. --------------
  29. =>  r0-> colour name
  30. <=  r1 = &BBGGRR00 of colour, or -1 if colour could not be found in database
  31.  
  32. Changes a colour name into a colour number. #rrggbb names will always work,
  33. but 'real' names require the database.
  34.  
  35. RGB_EncodeName (&90681 for the time being)
  36. --------------
  37. =>  r0-> &BBGGRR00 of colour
  38.     r1 = flags
  39.          b0 = 0 : find exact match
  40.               1 : find best match without resorting to #rrggbb
  41.     r2-> 64 byte block (128 bytes if b0 set)
  42. <=  r1-> name, or -1 if could not be matched
  43.     r0 = distance of returned colour from that requested, if b0 set
  44.           
  45. Changes a colour number into a colour name.
  46.  
  47. The 'best match' rule uses the same weightings as the ColourTrans module
  48. (R=2, G=4, B=1).
  49.  
  50.  
  51. Disclaimer
  52. ----------
  53. The author accepts no responsibility for any problems which this application
  54. may cause or loss of data resulting in its use. This applications is
  55. Public Domain Freeware. It may be used in any application, whether Freeware,
  56. Shareware, Commercial, or otherwise without any fee or licencing
  57. requirements. The code should not be modified however without my (Justin
  58. Fletcher's) consent.
  59.  
  60. I would like this module, or at least the interface to this module, to become
  61. a 'standard' means of accessing a colour database. Whether this will come
  62. about is anybody's guess...
  63.  
  64. I'd also like to say that the names in the rgb file were invented by someone
  65. else. I do not understand all of them. Things like PapayaWhip and cornsilk
  66. leave me completely confused. However, mine is not to reason why...
  67.  
  68.  
  69. Source code
  70. -----------
  71. Source code is available on request (however you like, but email is
  72. preferred).
  73.  
  74.  
  75. Contact
  76. -------
  77. Any comments, queries, donations or bug reports can be sent to Justin
  78. Fletcher at :
  79.  
  80. E-Mail : Gerph@essex.ac.uk
  81. URL    : http://users.essex.ac.uk/users/gerph
  82. IRC    : On #Acorn as Gerph
  83. Finger : finger gerph@innocent.com
  84. Tel    : (01842) 813979
  85.  
  86. Snail Mail :
  87.     Justin Fletcher
  88.     “Galadriel”
  89.     17b Cromwell Road,
  90.     Weeting,
  91.     Brandon,
  92.     Suffolk.
  93.     IP27 0QT
  94.  
  95.  
  96. History
  97. -------
  98. Version 1.00 : 15 Dec 1996
  99.                Module providing 2 SWIs to decode and encode the colour names
  100. Version 1.01 : 15 Dec 1996
  101.                Minor bug fix to allow EncodeName to work under all
  102.                circumstances (will return #rrggbb type colour if no database).
  103. Version 1.02 : 02 Dec 1997
  104.                Made RGB_DecodeName not require a buffer for working in. Added
  105.                *RGBColour command to display colours textually.
  106.